home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / Generic.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-02  |  2.2 KB  |  74 lines

  1. #if __SC__ || __RCC__
  2. #pragma once
  3. #endif
  4.  
  5. #ifndef _GENERIC_H_
  6. #define _GENERIC_H_
  7.  
  8. /*
  9.  *    generic.h -- for faking generic class declarations
  10.  *
  11.  * $Id: generic.h,v 1.1.1.1 1997/01/02 19:16:40 smarx Exp $
  12.  *
  13.  ****************************************************************************
  14.  *
  15.  * Rogue Wave Software, Inc.
  16.  * P.O. Box 2328
  17.  * Corvallis, OR 97339
  18.  * Voice: (503) 754-3010    FAX: (503) 757-6650
  19.  *
  20.  * Copyright (C) 1991,  1993, 1994.
  21.  * This software is subject to copyright protection under the laws of 
  22.  * the United States and other countries.
  23.  * ALL RIGHTS RESERVED
  24.  *
  25.  ***************************************************************************
  26.  *
  27.  * $Log: generic.h,v $
  28.  * Revision 1.1.1.1  1997/01/02 19:16:40  smarx
  29.  * cafe12
  30.  *
  31.  * 
  32.  *    Rev 1.2   08 Oct 1994 14:11:52   BUSHNELL
  33.  * Added pragma once for faster compilations
  34.  * 
  35.  *    Rev 1.1   02 Jun 1994 21:35:42   bushnell
  36.  * added ifdef so that MS RC will not include header twice
  37.  * 
  38.  *    Rev 1.0   28 Apr 1994 19:19:50   thompson                   
  39.  * Initial revision.
  40.  * 
  41.  *    Rev 1.0   20 Apr 1994 17:46:40   thompson                   
  42.  * Initial revision.
  43.  * Revision 1.2  1994/04/14  00:50:17  vriezen
  44.  * Updated copywrite, added ID and LOG and changed comments to indicate .cpp filename
  45.  *
  46.  *
  47.  * 
  48.  */
  49.  
  50.  
  51.  
  52. // token-pasting macros; ANSI requires an extra level of indirection
  53. #define name2(z, y)        name2_x(z, y)
  54. #define name2_x(z, y)        z##y
  55. #define name3(z, y, x)        name3_x(z, y, x)
  56. #define name3_x(z, y, x)    z##y##x
  57. #define name4(z, y, x, w)    name4_x(z, y, x, w)
  58. #define name4_x(z, y, x, w)    z##y##x##w
  59.  
  60. // macros for declaring and implementing classes
  61. #define declare(z, y)        name2(z, declare)(y)
  62. #define implement(z, y)        name2(z, implement)(y)
  63. #define declare2(z, y, x)    name2(z, declare2)(y, x)
  64. #define implement2(z, y, x)    name2(z, implement2)(y, x)
  65.  
  66. // macros for declaring error-handling functions
  67. extern genericerror(int, char*);
  68. typedef int (*GPT)(int, char*);
  69. #define set_handler(gen, tp, z)    name4(set_, tp, gen, _handler)(z)
  70. #define errorhandler(gen, tp)    name3(tp, gen, handler)
  71. #define callerror(gen, tp, z, y) (*errorhandler(gen, tp))(z, y)
  72.  
  73. #endif /* _GENERIC_H_ */
  74.